<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


Pattern-matching literal patterns
-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE CPP, ScopedTypeVariables #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore.Match.Literal</span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#dsLit"><span class="hs-identifier">dsLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#dsOverLit"><span class="hs-identifier">dsOverLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier">hsLitKey</span></a></span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#tidyLitPat"><span class="hs-identifier">tidyLitPat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#tidyNPat"><span class="hs-identifier">tidyNPat</span></a></span><span>
</span><span id="line-17"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#matchLiterals"><span class="hs-identifier">matchLiterals</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#matchNPlusKPats"><span class="hs-identifier">matchNPlusKPats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#matchNPats"><span class="hs-identifier">matchNPats</span></a></span><span>
</span><span id="line-18"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutIdentities"><span class="hs-identifier">warnAboutIdentities</span></a></span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedOverLit"><span class="hs-identifier">warnAboutOverflowedOverLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLit"><span class="hs-identifier">warnAboutOverflowedLit</span></a></span><span>
</span><span id="line-20"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutEmptyEnumerations"><span class="hs-identifier">warnAboutEmptyEnumerations</span></a></span><span>
</span><span id="line-21"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html"><span class="hs-identifier">GHC.HsToCore.Match</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier">match</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html"><span class="hs-identifier">GHC.HsToCore.Expr</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier">dsExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier">dsSyntaxExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html"><span class="hs-identifier">GHC.HsToCore.Monad</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Utils.html"><span class="hs-identifier">GHC.HsToCore.Utils</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#shortCutLit"><span class="hs-identifier">shortCutLit</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Ratio.html#"><span class="hs-identifier">Data.Ratio</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Outputable</span></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html"><span class="hs-identifier">GHC.Core.FamInstEnv</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnvs"><span class="hs-identifier">FamInstEnvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#normaliseType"><span class="hs-identifier">normaliseType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Int.html#"><span class="hs-identifier">Data.Int</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier">NonEmpty</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">NEL</span></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#"><span class="hs-identifier">Data.Proxy</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Desugaring literals
 [used to be in GHC.HsToCore.Expr, but GHC.HsToCore.Quote needs it,
  and it's nice to avoid a loop]
*                                                                      *
************************************************************************

We give int/float literals type @Integer@ and @Rational@, respectively.
The typechecker will (presumably) have put \tr{from{Integer,Rational}s}
around them.

ToDo: put in range checks for when converting ``@i@''
(or should that be in the typechecker?)

For numeric literals, we try to detect there use at a standard type
(@Int@, @Float@, etc.) are directly put in the right constructor.
[NB: down with the @App@ conversion.]

See also below where we look for @DictApps@ for \tr{plusInt}, etc.
-}</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#dsLit"><span class="hs-identifier hs-type">dsLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-91"></span><span id="dsLit"><span class="annot"><span class="annottext">dsLit :: HsLit GhcRn -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.Literal.html#dsLit"><span class="hs-identifier hs-var hs-var">dsLit</span></a></span></span><span> </span><span id="local-6989586621681148304"><span class="annot"><span class="annottext">HsLit GhcRn
</span><a href="#local-6989586621681148304"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-92"></span><span>  </span><span id="local-6989586621681148303"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148303"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-93"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148301"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681148301"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148303"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-94"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsLit GhcRn
</span><a href="#local-6989586621681148304"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-95"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsStringPrim"><span class="hs-identifier hs-type">HsStringPrim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsStringPrim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148298"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681148298"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitString"><span class="hs-identifier hs-var">LitString</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681148298"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsCharPrim"><span class="hs-identifier hs-type">HsCharPrim</span></a></span><span>   </span><span class="annot"><span class="annottext">XHsCharPrim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148294"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148294"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitChar"><span class="hs-identifier hs-var">LitChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148294"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-97"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntPrim"><span class="hs-identifier hs-type">HsIntPrim</span></a></span><span>    </span><span class="annot"><span class="annottext">XHsIntPrim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148291"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148291"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitIntWrap"><span class="hs-identifier hs-var">mkLitIntWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681148301"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148291"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsWordPrim"><span class="hs-identifier hs-type">HsWordPrim</span></a></span><span>   </span><span class="annot"><span class="annottext">XHsWordPrim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148288"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148288"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitWordWrap"><span class="hs-identifier hs-var">mkLitWordWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681148301"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148288"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsInt64Prim"><span class="hs-identifier hs-type">HsInt64Prim</span></a></span><span>  </span><span class="annot"><span class="annottext">XHsInt64Prim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148285"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148285"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitInt64Wrap"><span class="hs-identifier hs-var">mkLitInt64Wrap</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681148301"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148285"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsWord64Prim"><span class="hs-identifier hs-type">HsWord64Prim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsWord64Prim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148282"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148282"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitWord64Wrap"><span class="hs-identifier hs-var">mkLitWord64Wrap</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681148301"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148282"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsFloatPrim"><span class="hs-identifier hs-type">HsFloatPrim</span></a></span><span>  </span><span class="annot"><span class="annottext">XHsFloatPrim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148279"><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681148279"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitFloat"><span class="hs-identifier hs-var">LitFloat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FractionalLit -&gt; Rational
</span><a href="GHC.Types.Basic.html#fl_value"><span class="hs-identifier hs-var hs-var">fl_value</span></a></span><span> </span><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681148279"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsDoublePrim"><span class="hs-identifier hs-type">HsDoublePrim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsDoublePrim GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148275"><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681148275"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; CoreExpr
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitDouble"><span class="hs-identifier hs-var">LitDouble</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FractionalLit -&gt; Rational
</span><a href="GHC.Types.Basic.html#fl_value"><span class="hs-identifier hs-var hs-var">fl_value</span></a></span><span> </span><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681148275"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsChar"><span class="hs-identifier hs-type">HsChar</span></a></span><span> </span><span class="annot"><span class="annottext">XHsChar GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148272"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148272"><span class="hs-identifier hs-var">c</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCharExpr"><span class="hs-identifier hs-var">mkCharExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148272"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-104"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsString"><span class="hs-identifier hs-type">HsString</span></a></span><span> </span><span class="annot"><span class="annottext">XHsString GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148269"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681148269"><span class="hs-identifier hs-var">str</span></a></span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; DsM CoreExpr
forall (m :: * -&gt; *). MonadThings m =&gt; FastString -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkStringExprFS"><span class="hs-identifier hs-var">mkStringExprFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681148269"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-105"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsInteger"><span class="hs-identifier hs-type">HsInteger</span></a></span><span> </span><span class="annot"><span class="annottext">XHsInteger GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148266"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148266"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIntegerExpr"><span class="hs-identifier hs-var">mkIntegerExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148266"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsInt"><span class="hs-identifier hs-type">HsInt</span></a></span><span> </span><span class="annot"><span class="annottext">XHsInt GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148263"><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681148263"><span class="hs-identifier hs-var">i</span></a></span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIntExpr"><span class="hs-identifier hs-var">mkIntExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681148301"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var hs-var">il_value</span></a></span><span> </span><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681148263"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span>    </span><span class="annot"><a href="GHC.Hs.Lit.html#HsRat"><span class="hs-identifier hs-type">HsRat</span></a></span><span> </span><span class="annot"><span class="annottext">XHsRat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#FL"><span class="hs-identifier hs-type">FL</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148258"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681148258"><span class="hs-identifier hs-var">val</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681148257"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148257"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-108"></span><span>      </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681148255"><span class="hs-identifier hs-var">ratio_data_con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148253"><span class="hs-identifier hs-var">integer_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148252"><span class="hs-identifier hs-var">num</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148251"><span class="hs-identifier hs-var">denom</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-110"></span><span>        </span><span id="local-6989586621681148252"><span class="annot"><span class="annottext">num :: CoreExpr
</span><a href="#local-6989586621681148252"><span class="hs-identifier hs-var hs-var">num</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIntegerExpr"><span class="hs-identifier hs-var">mkIntegerExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Integer
forall a. Ratio a -&gt; a
</span><a href="../../base/src/GHC.Real.html#numerator"><span class="hs-identifier hs-var">numerator</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681148258"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span>        </span><span id="local-6989586621681148251"><span class="annot"><span class="annottext">denom :: CoreExpr
</span><a href="#local-6989586621681148251"><span class="hs-identifier hs-var hs-var">denom</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkIntegerExpr"><span class="hs-identifier hs-var">mkIntegerExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Integer
forall a. Ratio a -&gt; a
</span><a href="../../base/src/GHC.Real.html#denominator"><span class="hs-identifier hs-var">denominator</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621681148258"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681148255"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681148255"><span class="hs-identifier hs-var">ratio_data_con</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148253"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148253"><span class="hs-identifier hs-var">integer_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-113"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (TyCon, [Type])
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitTyConApp"><span class="hs-identifier hs-var">tcSplitTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148257"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-114"></span><span>                    </span><span class="hs-special">(</span><span id="local-6989586621681148236"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148236"><span class="hs-identifier hs-var">tycon</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681148235"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148235"><span class="hs-identifier hs-var">i_ty</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isIntegerTy</span><span> </span><span class="hs-identifier">i_ty</span><span> </span><span class="hs-operator">&amp;&amp;</span><span> </span><span class="hs-identifier">tycon</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">hasKey</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">ratioTyConKey</span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[DataCon] -&gt; DataCon
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-var">tyConDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148236"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148235"><span class="hs-identifier hs-var">i_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>                    </span><span id="local-6989586621681148225"><span class="annot"><span class="annottext">(TyCon, [Type])
</span><a href="#local-6989586621681148225"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (DataCon, Type)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsLit&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TyCon, [Type]) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">(TyCon, [Type])
</span><a href="#local-6989586621681148225"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#dsOverLit"><span class="hs-identifier hs-type">dsOverLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsOverLit"><span class="hs-identifier hs-type">HsOverLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-119"></span><span class="hs-comment">-- ^ Post-typechecker, the 'HsExpr' field of an 'OverLit' contains</span><span>
</span><span id="line-120"></span><span class="hs-comment">-- (an expression for) the literal value itself.</span><span>
</span><span id="line-121"></span><span id="dsOverLit"><span class="annot"><span class="annottext">dsOverLit :: HsOverLit GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.Literal.html#dsOverLit"><span class="hs-identifier hs-var hs-var">dsOverLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#OverLit"><span class="hs-identifier hs-type">OverLit</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ol_val :: forall p. HsOverLit p -&gt; OverLitVal
</span><a href="GHC.Hs.Lit.html#ol_val"><span class="hs-identifier hs-var">ol_val</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148220"><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681148220"><span class="hs-identifier hs-var">val</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ol_ext :: forall p. HsOverLit p -&gt; XOverLit p
</span><a href="GHC.Hs.Lit.html#ol_ext"><span class="hs-identifier hs-var">ol_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#OverLitTc"><span class="hs-identifier hs-type">OverLitTc</span></a></span><span> </span><span id="local-6989586621681148217"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681148217"><span class="hs-identifier hs-var">rebindable</span></a></span></span><span> </span><span id="local-6989586621681148216"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148216"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-122"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ol_witness :: forall p. HsOverLit p -&gt; HsExpr p
</span><a href="GHC.Hs.Lit.html#ol_witness"><span class="hs-identifier hs-var">ol_witness</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148214"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681148214"><span class="hs-identifier hs-var">witness</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-123"></span><span>  </span><span id="local-6989586621681148213"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148213"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148212"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681148212"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148213"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-125"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OverLitVal -&gt; Type -&gt; Maybe (HsExpr GhcTc)
</span><a href="GHC.Tc.Utils.Zonk.html#shortCutLit"><span class="hs-identifier hs-var">shortCutLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681148212"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681148220"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148216"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-126"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148211"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681148211"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681148217"><span class="hs-identifier hs-var">rebindable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681148211"><span class="hs-identifier hs-var">expr</span></a></span><span>        </span><span class="hs-comment">-- Note [Literal short cut]</span><span>
</span><span id="line-127"></span><span>    </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcTc)
</span><span class="hs-identifier">_</span></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsExpr"><span class="hs-identifier hs-var">dsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681148214"><span class="hs-identifier hs-var">witness</span></a></span><span>
</span><span id="line-128"></span><span class="hs-comment">{-
Note [Literal short cut]
~~~~~~~~~~~~~~~~~~~~~~~~
The type checker tries to do this short-cutting as early as possible, but
because of unification etc, more information is available to the desugarer.
And where it's possible to generate the correct literal right away, it's
much better to do so.


************************************************************************
*                                                                      *
                 Warnings about overflowed literals
*                                                                      *
************************************************************************

Warn about functions like toInteger, fromIntegral, that convert
between one type and another when the to- and from- types are the
same.  Then it's probably (albeit not definitely) the identity
-}</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutIdentities"><span class="hs-identifier hs-type">warnAboutIdentities</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span id="warnAboutIdentities"><span class="annot"><span class="annottext">warnAboutIdentities :: DynFlags -&gt; Id -&gt; Type -&gt; DsM ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutIdentities"><span class="hs-identifier hs-var hs-var">warnAboutIdentities</span></a></span></span><span> </span><span id="local-6989586621681148210"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148210"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681148209"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681148209"><span class="hs-identifier hs-var">conv_fn</span></a></span></span><span> </span><span id="local-6989586621681148208"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148208"><span class="hs-identifier hs-var">type_of_conv</span></a></span></span><span>
</span><span id="line-150"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#wopt"><span class="hs-identifier hs-var">wopt</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnIdentities"><span class="hs-identifier hs-var">Opt_WarnIdentities</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148210"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-151"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681148209"><span class="hs-identifier hs-var">conv_fn</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="GHC.HsToCore.Match.Literal.html#conversionNames"><span class="hs-identifier hs-var">conversionNames</span></a></span><span>
</span><span id="line-152"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148202"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148202"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148201"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148201"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe (Type, Type, Type)
</span><a href="GHC.Core.Type.html#splitFunTy_maybe"><span class="hs-identifier hs-var">splitFunTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148208"><span class="hs-identifier hs-var">type_of_conv</span></a></span><span>
</span><span id="line-153"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148202"><span class="hs-identifier hs-var">arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148201"><span class="hs-identifier hs-var">res_ty</span></a></span><span>  </span><span class="hs-comment">-- So we are converting  ty -&gt; ty</span><span>
</span><span id="line-154"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnIdentities"><span class="hs-identifier hs-var">Opt_WarnIdentities</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Call of&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681148209"><span class="hs-identifier hs-var">conv_fn</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148208"><span class="hs-identifier hs-var">type_of_conv</span></a></span><span>
</span><span id="line-156"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;can probably be omitted&quot;</span></span><span>
</span><span id="line-157"></span><span>           </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutIdentities"><span class="hs-identifier hs-var">warnAboutIdentities</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#conversionNames"><span class="hs-identifier hs-type">conversionNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-161"></span><span id="conversionNames"><span class="annot"><span class="annottext">conversionNames :: [Name]
</span><a href="GHC.HsToCore.Match.Literal.html#conversionNames"><span class="hs-identifier hs-var hs-var">conversionNames</span></a></span></span><span>
</span><span id="line-162"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#toIntegerName"><span class="hs-identifier hs-var">toIntegerName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#toRationalName"><span class="hs-identifier hs-var">toRationalName</span></a></span><span>
</span><span id="line-163"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#fromIntegralName"><span class="hs-identifier hs-var">fromIntegralName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#realToFracName"><span class="hs-identifier hs-var">realToFracName</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-164"></span><span> </span><span class="hs-comment">-- We can't easily add fromIntegerName, fromRationalName,</span><span>
</span><span id="line-165"></span><span> </span><span class="hs-comment">-- because they are generated by literals</span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-comment">-- | Emit warnings on overloaded integral literals which overflow the bounds</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- implied by their type.</span><span>
</span><span id="line-170"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedOverLit"><span class="hs-identifier hs-type">warnAboutOverflowedOverLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsOverLit"><span class="hs-identifier hs-type">HsOverLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span id="warnAboutOverflowedOverLit"><span class="annot"><span class="annottext">warnAboutOverflowedOverLit :: HsOverLit GhcTc -&gt; DsM ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedOverLit"><span class="hs-identifier hs-var hs-var">warnAboutOverflowedOverLit</span></a></span></span><span> </span><span id="local-6989586621681148187"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681148187"><span class="hs-identifier hs-var">hsOverLit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-172"></span><span>  </span><span id="local-6989586621681148186"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148186"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-173"></span><span>  </span><span id="local-6989586621681148185"><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148185"><span class="hs-identifier hs-var">fam_envs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DsM FamInstEnvs
</span><a href="GHC.HsToCore.Monad.html#dsGetFamInstEnvs"><span class="hs-identifier hs-var">dsGetFamInstEnvs</span></a></span><span>
</span><span id="line-174"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe (Integer, Name) -&gt; DsM ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLiterals"><span class="hs-identifier hs-var">warnAboutOverflowedLiterals</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148186"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Integer, Name) -&gt; DsM ())
-&gt; Maybe (Integer, Name) -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-175"></span><span>      </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getIntegralLit"><span class="hs-identifier hs-var">getIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681148187"><span class="hs-identifier hs-var">hsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Type)
-&gt; ((Integer, Type) -&gt; Maybe (Integer, Name))
-&gt; Maybe (Integer, Name)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs -&gt; (Integer, Type) -&gt; Maybe (Integer, Name)
</span><a href="GHC.HsToCore.Match.Literal.html#getNormalisedTyconName"><span class="hs-identifier hs-var">getNormalisedTyconName</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148185"><span class="hs-identifier hs-var">fam_envs</span></a></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">-- | Emit warnings on integral literals which overflow the bounds implied by</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- their type.</span><span>
</span><span id="line-179"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLit"><span class="hs-identifier hs-type">warnAboutOverflowedLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span id="warnAboutOverflowedLit"><span class="annot"><span class="annottext">warnAboutOverflowedLit :: HsLit GhcTc -&gt; DsM ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLit"><span class="hs-identifier hs-var hs-var">warnAboutOverflowedLit</span></a></span></span><span> </span><span id="local-6989586621681148180"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681148180"><span class="hs-identifier hs-var">hsLit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-181"></span><span>  </span><span id="local-6989586621681148179"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148179"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-182"></span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe (Integer, Name) -&gt; DsM ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLiterals"><span class="hs-identifier hs-var">warnAboutOverflowedLiterals</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148179"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Integer, Name) -&gt; DsM ())
-&gt; Maybe (Integer, Name) -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-183"></span><span>      </span><span class="annot"><span class="annottext">HsLit GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681148180"><span class="hs-identifier hs-var">hsLit</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Type)
-&gt; ((Integer, Type) -&gt; Maybe (Integer, Name))
-&gt; Maybe (Integer, Name)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Name)
</span><a href="GHC.HsToCore.Match.Literal.html#getTyconName"><span class="hs-identifier hs-var">getTyconName</span></a></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-comment">-- | Emit warnings on integral literals which overflow the bounds implied by</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- their type.</span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLiterals"><span class="hs-identifier hs-type">warnAboutOverflowedLiterals</span></a></span><span>
</span><span id="line-188"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-189"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ the literal value and name of its tycon</span><span>
</span><span id="line-190"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span id="warnAboutOverflowedLiterals"><span class="annot"><span class="annottext">warnAboutOverflowedLiterals :: DynFlags -&gt; Maybe (Integer, Name) -&gt; DsM ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutOverflowedLiterals"><span class="hs-identifier hs-var hs-var">warnAboutOverflowedLiterals</span></a></span></span><span> </span><span id="local-6989586621681148176"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148176"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681148175"><span class="annot"><span class="annottext">Maybe (Integer, Name)
</span><a href="#local-6989586621681148175"><span class="hs-identifier hs-var">lit</span></a></span></span><span>
</span><span id="line-192"></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#wopt"><span class="hs-identifier hs-var">wopt</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnOverflowedLiterals"><span class="hs-identifier hs-var">Opt_WarnOverflowedLiterals</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148176"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-193"></span><span> </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148173"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148172"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Name)
</span><a href="#local-6989586621681148175"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-194"></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="hs-keyword">if</span><span>      </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#intTyConName"><span class="hs-identifier hs-var">intTyConName</span></a></span><span>     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>    </span><span class="hs-comment">-- These only show up via the 'HsOverLit' route</span><span>
</span><span id="line-197"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int8TyConName"><span class="hs-identifier hs-var">int8TyConName</span></a></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int8 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int8
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int8"><span class="hs-identifier hs-type">Int8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int16TyConName"><span class="hs-identifier hs-var">int16TyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int16 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int16
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int32TyConName"><span class="hs-identifier hs-var">int32TyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int32 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int32
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int64TyConName"><span class="hs-identifier hs-var">int64TyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int64 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int64
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-201"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#wordTyConName"><span class="hs-identifier hs-var">wordTyConName</span></a></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">)</span><span>
</span><span id="line-202"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#word8TyConName"><span class="hs-identifier hs-var">word8TyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word8 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word8
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-203"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#word16TyConName"><span class="hs-identifier hs-var">word16TyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word16 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word16
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-204"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#word32TyConName"><span class="hs-identifier hs-var">word32TyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word32 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word32
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-205"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#word64TyConName"><span class="hs-identifier hs-var">word64TyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word64 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word64
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-206"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#naturalTyConName"><span class="hs-identifier hs-var">naturalTyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; DsM ()
</span><a href="#local-6989586621681148158"><span class="hs-identifier hs-var">checkPositive</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span>    </span><span class="hs-comment">-- These only show up via the 'HsLit' route</span><span>
</span><span id="line-209"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#intPrimTyConName"><span class="hs-identifier hs-var">intPrimTyConName</span></a></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-210"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#int8PrimTyConName"><span class="hs-identifier hs-var">int8PrimTyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int8 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int8
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int8"><span class="hs-identifier hs-type">Int8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#int32PrimTyConName"><span class="hs-identifier hs-var">int32PrimTyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int32 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int32
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-212"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#int64PrimTyConName"><span class="hs-identifier hs-var">int64PrimTyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Int64 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int64
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-213"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#wordPrimTyConName"><span class="hs-identifier hs-var">wordPrimTyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#word8PrimTyConName"><span class="hs-identifier hs-var">word8PrimTyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word8 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word8
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-215"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#word32PrimTyConName"><span class="hs-identifier hs-var">word32PrimTyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word32 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word32
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-216"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.Prim.html#word64PrimTyConName"><span class="hs-identifier hs-var">word64PrimTyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Name -&gt; Proxy Word64 -&gt; DsM ()
forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148173"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148172"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word64
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span>    </span><span class="annot"><a href="#local-6989586621681148158"><span class="hs-identifier hs-type">checkPositive</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-224"></span><span>    </span><span id="local-6989586621681148158"><span class="annot"><span class="annottext">checkPositive :: Integer -&gt; Name -&gt; DsM ()
</span><a href="#local-6989586621681148158"><span class="hs-identifier hs-var hs-var">checkPositive</span></a></span></span><span> </span><span id="local-6989586621681148149"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148149"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621681148148"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148148"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-225"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; DsM () -&gt; DsM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148149"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(DsM () -&gt; DsM ()) -&gt; DsM () -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-226"></span><span>        </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnOverflowedLiterals"><span class="hs-identifier hs-var">Opt_WarnOverflowedLiterals</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-227"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Literal&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#integer"><span class="hs-identifier hs-var">integer</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148149"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-228"></span><span>                       </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is negative but&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148148"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-229"></span><span>                       </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;only supports positive numbers&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>                     </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span>    </span><span class="annot"><a href="#local-6989586621681148170"><span class="hs-identifier hs-type">check</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681148633"><span class="annot"><a href="#local-6989586621681148633"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Enum.html#Bounded"><span class="hs-identifier hs-type">Bounded</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681148633"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#Integral"><span class="hs-identifier hs-type">Integral</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681148633"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681148633"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>    </span><span id="local-6989586621681148170"><span class="annot"><span class="annottext">check :: forall a.
(Bounded a, Integral a) =&gt;
Integer -&gt; Name -&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148170"><span class="hs-identifier hs-var hs-var">check</span></a></span></span><span> </span><span id="local-6989586621681148136"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148136"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621681148135"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148135"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621681148134"><span class="annot"><span class="annottext">Proxy a
</span><a href="#local-6989586621681148134"><span class="hs-identifier hs-var">_proxy</span></a></span></span><span>
</span><span id="line-234"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; DsM () -&gt; DsM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148136"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148133"><span class="hs-identifier hs-var">minB</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148136"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148130"><span class="hs-identifier hs-var">maxB</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(DsM () -&gt; DsM ()) -&gt; DsM () -&gt; DsM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-235"></span><span>        </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnOverflowedLiterals"><span class="hs-identifier hs-var">Opt_WarnOverflowedLiterals</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Literal&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#integer"><span class="hs-identifier hs-var">integer</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148136"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-237"></span><span>                       </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is out of the&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148135"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;range&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-238"></span><span>                       </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#integer"><span class="hs-identifier hs-var">integer</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148133"><span class="hs-identifier hs-var">minB</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;..&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#integer"><span class="hs-identifier hs-var">integer</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148130"><span class="hs-identifier hs-var">maxB</span></a></span><span>
</span><span id="line-239"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681148128"><span class="hs-identifier hs-var">sug</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-240"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-241"></span><span>        </span><span id="local-6989586621681148133"><span class="annot"><span class="annottext">minB :: Integer
</span><a href="#local-6989586621681148133"><span class="hs-identifier hs-var hs-var">minB</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Bounded a =&gt; a
</span><a href="../../base/src/GHC.Enum.html#minBound"><span class="hs-identifier hs-var">minBound</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681148633"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>        </span><span id="local-6989586621681148130"><span class="annot"><span class="annottext">maxB :: Integer
</span><a href="#local-6989586621681148130"><span class="hs-identifier hs-var hs-var">maxB</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Bounded a =&gt; a
</span><a href="../../base/src/GHC.Enum.html#maxBound"><span class="hs-identifier hs-var">maxBound</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681148633"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>        </span><span id="local-6989586621681148128"><span class="annot"><span class="annottext">sug :: SDoc
</span><a href="#local-6989586621681148128"><span class="hs-identifier hs-var hs-var">sug</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148133"><span class="hs-identifier hs-var">minB</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148136"><span class="hs-identifier hs-var">i</span></a></span><span>   </span><span class="hs-comment">-- Note [Suggest NegativeLiterals]</span><span>
</span><span id="line-244"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148136"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span>
</span><span id="line-245"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#NegativeLiterals"><span class="hs-identifier hs-var">LangExt.NegativeLiterals</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148176"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;If you are trying to write a large negative literal, use NegativeLiterals&quot;</span></span><span>
</span><span id="line-247"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">{-
Note [Suggest NegativeLiterals]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you write
  x :: Int8
  x = -128
it'll parse as (negate 128), and overflow.  In this case, suggest NegativeLiterals.
We get an erroneous suggestion for
  x = 128
but perhaps that does not matter too much.
-}</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#warnAboutEmptyEnumerations"><span class="hs-identifier hs-type">warnAboutEmptyEnumerations</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnvs"><span class="hs-identifier hs-type">FamInstEnvs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-262"></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-263"></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-264"></span><span class="hs-comment">-- ^ Warns about @[2,3 .. 1]@ or @['b' .. 'a']@ which return the empty list.</span><span>
</span><span id="line-265"></span><span class="hs-comment">-- For numeric literals, only works for integral types, not floating point.</span><span>
</span><span id="line-266"></span><span id="warnAboutEmptyEnumerations"><span class="annot"><span class="annottext">warnAboutEmptyEnumerations :: FamInstEnvs
-&gt; DynFlags
-&gt; LHsExpr GhcTc
-&gt; Maybe (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; DsM ()
</span><a href="GHC.HsToCore.Match.Literal.html#warnAboutEmptyEnumerations"><span class="hs-identifier hs-var hs-var">warnAboutEmptyEnumerations</span></a></span></span><span> </span><span id="local-6989586621681148113"><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148113"><span class="hs-identifier hs-var">fam_envs</span></a></span></span><span> </span><span id="local-6989586621681148112"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148112"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681148111"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148111"><span class="hs-identifier hs-var">fromExpr</span></a></span></span><span> </span><span id="local-6989586621681148110"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681148110"><span class="hs-identifier hs-var">mThnExpr</span></a></span></span><span> </span><span id="local-6989586621681148109"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148109"><span class="hs-identifier hs-var">toExpr</span></a></span></span><span>
</span><span id="line-267"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#wopt"><span class="hs-identifier hs-var">wopt</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnEmptyEnumerations"><span class="hs-identifier hs-var">Opt_WarnEmptyEnumerations</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681148112"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-268"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-269"></span><span>  </span><span class="hs-comment">-- Numeric Literals</span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148107"><span class="annot"><span class="annottext">from_ty :: (Integer, Type)
</span><a href="#local-6989586621681148107"><span class="hs-identifier hs-var">from_ty</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681148106"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148106"><span class="hs-identifier hs-var">from</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148111"><span class="hs-identifier hs-var">fromExpr</span></a></span><span>
</span><span id="line-271"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148104"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FamInstEnvs -&gt; (Integer, Type) -&gt; Maybe (Integer, Name)
</span><a href="GHC.HsToCore.Match.Literal.html#getNormalisedTyconName"><span class="hs-identifier hs-var">getNormalisedTyconName</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148113"><span class="hs-identifier hs-var">fam_envs</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer, Type)
</span><a href="#local-6989586621681148107"><span class="hs-identifier hs-var">from_ty</span></a></span><span>
</span><span id="line-272"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148103"><span class="annot"><span class="annottext">Maybe (Integer, Type)
</span><a href="#local-6989586621681148103"><span class="hs-identifier hs-var">mThn</span></a></span></span><span>             </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; Maybe (Integer, Type))
-&gt; Maybe (LHsExpr GhcTc) -&gt; Maybe (Maybe (Integer, Type))
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681148110"><span class="hs-identifier hs-var">mThnExpr</span></a></span><span>
</span><span id="line-273"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148101"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148101"><span class="hs-identifier hs-var">to</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148109"><span class="hs-identifier hs-var">toExpr</span></a></span><span>
</span><span id="line-274"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681148100"><span class="hs-identifier hs-type">check</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681148618"><span class="annot"><a href="#local-6989586621681148618"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Enum.html#Enum"><span class="hs-identifier hs-type">Enum</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681148618"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681148618"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681148618"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>        </span><span id="local-6989586621681148100"><span class="annot"><span class="annottext">check :: forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var hs-var">check</span></a></span></span><span> </span><span id="local-6989586621681148088"><span class="annot"><span class="annottext">Proxy a
</span><a href="#local-6989586621681148088"><span class="hs-identifier hs-var">_proxy</span></a></span></span><span>
</span><span id="line-276"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; DsM () -&gt; DsM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681148086"><span class="hs-identifier hs-var">enumeration</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">DsM ()
</span><a href="#local-6989586621681148085"><span class="hs-identifier hs-var">raiseWarning</span></a></span><span>
</span><span id="line-277"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-278"></span><span>            </span><span class="annot"><a href="#local-6989586621681148086"><span class="hs-identifier hs-type">enumeration</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681148618"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-279"></span><span>            </span><span id="local-6989586621681148086"><span class="annot"><span class="annottext">enumeration :: [a]
</span><a href="#local-6989586621681148086"><span class="hs-identifier hs-var hs-var">enumeration</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Type)
</span><a href="#local-6989586621681148103"><span class="hs-identifier hs-var">mThn</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-280"></span><span>                            </span><span class="annot"><span class="annottext">Maybe (Integer, Type)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Integer -&gt; a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148106"><span class="hs-identifier hs-var">from</span></a></span><span>                    </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148101"><span class="hs-identifier hs-var">to</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-281"></span><span>                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148084"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148084"><span class="hs-identifier hs-var">thn</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Integer -&gt; a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148106"><span class="hs-identifier hs-var">from</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148084"><span class="hs-identifier hs-var">thn</span></a></span><span>   </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; a
forall a. Num a =&gt; Integer -&gt; a
</span><a href="../../base/src/GHC.Num.html#fromInteger"><span class="hs-identifier hs-var">fromInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148101"><span class="hs-identifier hs-var">to</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span>      </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#intTyConName"><span class="hs-identifier hs-var">intTyConName</span></a></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Int -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int8TyConName"><span class="hs-identifier hs-var">int8TyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Int8 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int8
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int8"><span class="hs-identifier hs-type">Int8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int16TyConName"><span class="hs-identifier hs-var">int16TyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Int16 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int16
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int16"><span class="hs-identifier hs-type">Int16</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int32TyConName"><span class="hs-identifier hs-var">int32TyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Int32 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int32
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int32"><span class="hs-identifier hs-type">Int32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-287"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#int64TyConName"><span class="hs-identifier hs-var">int64TyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Int64 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Int64
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#wordTyConName"><span class="hs-identifier hs-var">wordTyConName</span></a></span><span>   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Word -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Word</span></span><span class="hs-special">)</span><span>
</span><span id="line-289"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#word8TyConName"><span class="hs-identifier hs-var">word8TyConName</span></a></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Word8 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word8
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#word16TyConName"><span class="hs-identifier hs-var">word16TyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Word16 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word16
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-291"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#word32TyConName"><span class="hs-identifier hs-var">word32TyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Word32 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word32
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#word64TyConName"><span class="hs-identifier hs-var">word64TyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Word64 -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Word64
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#integerTyConName"><span class="hs-identifier hs-var">integerTyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Integer -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Integer
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148104"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Types.html#naturalTyConName"><span class="hs-identifier hs-var">naturalTyConName</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Proxy Integer -&gt; DsM ()
forall a. (Enum a, Num a) =&gt; Proxy a -&gt; DsM ()
</span><a href="#local-6989586621681148100"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy Integer
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">)</span><span>
</span><span id="line-295"></span><span>      </span><span class="hs-comment">-- We use 'Integer' because otherwise a negative 'Natural' literal</span><span>
</span><span id="line-296"></span><span>      </span><span class="hs-comment">-- could cause a compile time crash (instead of a runtime one).</span><span>
</span><span id="line-297"></span><span>      </span><span class="hs-comment">-- See the T10930b test case for an example of where this matters.</span><span>
</span><span id="line-298"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-comment">-- Char literals (#18402)</span><span>
</span><span id="line-301"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148082"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148082"><span class="hs-identifier hs-var">fromChar</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe Char
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148111"><span class="hs-identifier hs-var">fromExpr</span></a></span><span>
</span><span id="line-302"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148080"><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621681148080"><span class="hs-identifier hs-var">mThnChar</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; Maybe Char)
-&gt; Maybe (LHsExpr GhcTc) -&gt; Maybe (Maybe Char)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe Char
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681148110"><span class="hs-identifier hs-var">mThnExpr</span></a></span><span>
</span><span id="line-303"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148079"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148079"><span class="hs-identifier hs-var">toChar</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe Char
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148109"><span class="hs-identifier hs-var">toExpr</span></a></span><span>
</span><span id="line-304"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148075"><span class="annot"><span class="annottext">enumeration :: String
</span><a href="#local-6989586621681148075"><span class="hs-identifier hs-var hs-var">enumeration</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621681148080"><span class="hs-identifier hs-var">mThnChar</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-305"></span><span>                        </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148082"><span class="hs-identifier hs-var">fromChar</span></a></span><span>          </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148079"><span class="hs-identifier hs-var">toChar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-306"></span><span>                        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148074"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148074"><span class="hs-identifier hs-var">thnChar</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148082"><span class="hs-identifier hs-var">fromChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148074"><span class="hs-identifier hs-var">thnChar</span></a></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148079"><span class="hs-identifier hs-var">toChar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; DsM () -&gt; DsM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681148075"><span class="hs-identifier hs-var">enumeration</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">DsM ()
</span><a href="#local-6989586621681148085"><span class="hs-identifier hs-var">raiseWarning</span></a></span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; DsM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-311"></span><span>    </span><span id="local-6989586621681148085"><span class="annot"><span class="annottext">raiseWarning :: DsM ()
</span><a href="#local-6989586621681148085"><span class="hs-identifier hs-var hs-var">raiseWarning</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; DsM ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnEmptyEnumerations"><span class="hs-identifier hs-var">Opt_WarnEmptyEnumerations</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Enumeration is empty&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-type">getLHsIntegralLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-314"></span><span class="hs-comment">-- ^ See if the expression is an 'Integral' literal.</span><span>
</span><span id="line-315"></span><span class="hs-comment">-- Remember to look through automatically-added tick-boxes! (#8384)</span><span>
</span><span id="line-316"></span><span id="getLHsIntegralLit"><span class="annot"><span class="annottext">getLHsIntegralLit :: LHsExpr GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var hs-var">getLHsIntegralLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsPar"><span class="hs-identifier hs-type">HsPar</span></a></span><span> </span><span class="annot"><span class="annottext">XPar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148071"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148071"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148071"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-317"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsTick"><span class="hs-identifier hs-type">HsTick</span></a></span><span> </span><span class="annot"><span class="annottext">XTick GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Tickish (IdP GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148069"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148069"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148069"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-318"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsBinTick"><span class="hs-identifier hs-type">HsBinTick</span></a></span><span> </span><span class="annot"><span class="annottext">XBinTick GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148067"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148067"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148067"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-319"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsOverLit"><span class="hs-identifier hs-type">HsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">XOverLitE GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148065"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681148065"><span class="hs-identifier hs-var">over_lit</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getIntegralLit"><span class="hs-identifier hs-var">getIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681148065"><span class="hs-identifier hs-var">over_lit</span></a></span><span>
</span><span id="line-320"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><span class="annottext">XLitE GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148063"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681148063"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681148063"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-321"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsIntegralLit"><span class="hs-identifier hs-var">getLHsIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Type)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span class="hs-comment">-- | If 'Integral', extract the value and type of the overloaded literal.</span><span>
</span><span id="line-324"></span><span class="hs-comment">-- See Note [Literals and the OverloadedLists extension]</span><span>
</span><span id="line-325"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getIntegralLit"><span class="hs-identifier hs-type">getIntegralLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsOverLit"><span class="hs-identifier hs-type">HsOverLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-326"></span><span id="getIntegralLit"><span class="annot"><span class="annottext">getIntegralLit :: HsOverLit GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getIntegralLit"><span class="hs-identifier hs-var hs-var">getIntegralLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#OverLit"><span class="hs-identifier hs-type">OverLit</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ol_val :: forall p. HsOverLit p -&gt; OverLitVal
</span><a href="GHC.Hs.Lit.html#ol_val"><span class="hs-identifier hs-var">ol_val</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntegral"><span class="hs-identifier hs-type">HsIntegral</span></a></span><span> </span><span id="local-6989586621681148061"><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681148061"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ol_ext :: forall p. HsOverLit p -&gt; XOverLit p
</span><a href="GHC.Hs.Lit.html#ol_ext"><span class="hs-identifier hs-var">ol_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#OverLitTc"><span class="hs-identifier hs-type">OverLitTc</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148060"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148060"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-327"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Type)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var hs-var">il_value</span></a></span><span> </span><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681148061"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148060"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-328"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getIntegralLit"><span class="hs-identifier hs-var">getIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Type)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-329"></span><span>
</span><span id="line-330"></span><span class="hs-comment">-- | If 'Integral', extract the value and type of the non-overloaded literal.</span><span>
</span><span id="line-331"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-type">getSimpleIntegralLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span id="getSimpleIntegralLit"><span class="annot"><span class="annottext">getSimpleIntegralLit :: HsLit GhcTc -&gt; Maybe (Integer, Type)
</span><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var hs-var">getSimpleIntegralLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsInt"><span class="hs-identifier hs-type">HsInt</span></a></span><span> </span><span class="annot"><span class="annottext">XHsInt GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#IL"><span class="hs-identifier hs-type">IL</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">il_value :: IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var">il_value</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148058"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148058"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Type)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148058"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#intTy"><span class="hs-identifier hs-var">intTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntPrim"><span class="hs-identifier hs-type">HsIntPrim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsIntPrim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148056"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148056"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Type)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148056"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#intPrimTy"><span class="hs-identifier hs-var">intPrimTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsWordPrim"><span class="hs-identifier hs-type">HsWordPrim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsWordPrim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148054"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148054"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Type)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148054"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#wordPrimTy"><span class="hs-identifier hs-var">wordPrimTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsInt64Prim"><span class="hs-identifier hs-type">HsInt64Prim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsInt64Prim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148052"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148052"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Type)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148052"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#int64PrimTy"><span class="hs-identifier hs-var">int64PrimTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsWord64Prim"><span class="hs-identifier hs-type">HsWord64Prim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsWord64Prim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148050"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148050"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Type)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148050"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#word64PrimTy"><span class="hs-identifier hs-var">word64PrimTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsInteger"><span class="hs-identifier hs-type">HsInteger</span></a></span><span> </span><span class="annot"><span class="annottext">XHsInteger GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148048"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148048"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621681148047"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148047"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Type) -&gt; Maybe (Integer, Type)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148048"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148047"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getSimpleIntegralLit"><span class="hs-identifier hs-var">getSimpleIntegralLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Type)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span class="hs-comment">-- | Extract the Char if the expression is a Char literal.</span><span>
</span><span id="line-341"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-type">getLHsCharLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>
</span><span id="line-342"></span><span id="getLHsCharLit"><span class="annot"><span class="annottext">getLHsCharLit :: LHsExpr GhcTc -&gt; Maybe Char
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var hs-var">getLHsCharLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsPar"><span class="hs-identifier hs-type">HsPar</span></a></span><span> </span><span class="annot"><span class="annottext">XPar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148046"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148046"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe Char
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148046"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-343"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsTick"><span class="hs-identifier hs-type">HsTick</span></a></span><span> </span><span class="annot"><span class="annottext">XTick GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Tickish (IdP GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148045"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148045"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe Char
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148045"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-344"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsBinTick"><span class="hs-identifier hs-type">HsBinTick</span></a></span><span> </span><span class="annot"><span class="annottext">XBinTick GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148044"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148044"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe Char
</span><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681148044"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-345"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><span class="annottext">XLitE GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsChar"><span class="hs-identifier hs-type">HsChar</span></a></span><span> </span><span class="annot"><span class="annottext">XHsChar GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681148043"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148043"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Maybe Char
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148043"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-346"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getLHsCharLit"><span class="hs-identifier hs-var">getLHsCharLit</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Char
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-comment">-- | Convert a pair (Integer, Type) to (Integer, Name) after eventually</span><span>
</span><span id="line-349"></span><span class="hs-comment">-- normalising the type</span><span>
</span><span id="line-350"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getNormalisedTyconName"><span class="hs-identifier hs-type">getNormalisedTyconName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnvs"><span class="hs-identifier hs-type">FamInstEnvs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span id="getNormalisedTyconName"><span class="annot"><span class="annottext">getNormalisedTyconName :: FamInstEnvs -&gt; (Integer, Type) -&gt; Maybe (Integer, Name)
</span><a href="GHC.HsToCore.Match.Literal.html#getNormalisedTyconName"><span class="hs-identifier hs-var hs-var">getNormalisedTyconName</span></a></span></span><span> </span><span id="local-6989586621681148042"><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148042"><span class="hs-identifier hs-var">fam_envs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148041"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148041"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681148040"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148040"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-352"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148039"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148039"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe TyCon
</span><a href="GHC.Core.Type.html#tyConAppTyCon_maybe"><span class="hs-identifier hs-var">tyConAppTyCon_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FamInstEnvs -&gt; Type -&gt; Type
</span><a href="#local-6989586621681148037"><span class="hs-identifier hs-var">normaliseNominal</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148042"><span class="hs-identifier hs-var">fam_envs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148040"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Name) -&gt; Maybe (Integer, Name)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148041"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148039"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Name)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-355"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-356"></span><span>    </span><span class="annot"><a href="#local-6989586621681148037"><span class="hs-identifier hs-type">normaliseNominal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnvs"><span class="hs-identifier hs-type">FamInstEnvs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-357"></span><span>    </span><span id="local-6989586621681148037"><span class="annot"><span class="annottext">normaliseNominal :: FamInstEnvs -&gt; Type -&gt; Type
</span><a href="#local-6989586621681148037"><span class="hs-identifier hs-var hs-var">normaliseNominal</span></a></span></span><span> </span><span id="local-6989586621681148035"><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148035"><span class="hs-identifier hs-var">fam_envs</span></a></span></span><span> </span><span id="local-6989586621681148034"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148034"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Coercion, Type) -&gt; Type
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">((Coercion, Type) -&gt; Type) -&gt; (Coercion, Type) -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs -&gt; Role -&gt; Type -&gt; (Coercion, Type)
</span><a href="GHC.Core.FamInstEnv.html#normaliseType"><span class="hs-identifier hs-var">normaliseType</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681148035"><span class="hs-identifier hs-var">fam_envs</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148034"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-358"></span><span>
</span><span id="line-359"></span><span class="hs-comment">-- | Convert a pair (Integer, Type) to (Integer, Name) without normalising</span><span>
</span><span id="line-360"></span><span class="hs-comment">-- the type</span><span>
</span><span id="line-361"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#getTyconName"><span class="hs-identifier hs-type">getTyconName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-362"></span><span id="getTyconName"><span class="annot"><span class="annottext">getTyconName :: (Integer, Type) -&gt; Maybe (Integer, Name)
</span><a href="GHC.HsToCore.Match.Literal.html#getTyconName"><span class="hs-identifier hs-var hs-var">getTyconName</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148032"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148032"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681148031"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148031"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148030"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148030"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe TyCon
</span><a href="GHC.Core.Type.html#tyConAppTyCon_maybe"><span class="hs-identifier hs-var">tyConAppTyCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148031"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Integer, Name) -&gt; Maybe (Integer, Name)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148032"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148030"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-364"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Integer, Name)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span class="hs-comment">{-
Note [Literals and the OverloadedLists extension]
~~~~
Consider the Literal `[256] :: [Data.Word.Word8]`

When the `OverloadedLists` extension is not active, then the `ol_ext` field
in the `OverLitTc` record that is passed to the function `getIntegralLit`
contains the type `Word8`. This is a simple type, and we can use its
type constructor immediately for the `warnAboutOverflowedLiterals` function.

When the `OverloadedLists` extension is active, then the `ol_ext` field
contains the type family `Item [Word8]`. The function `nomaliseType` is used
to convert it to the needed type `Word8`.
-}</span><span>
</span><span id="line-380"></span><span>
</span><span id="line-381"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
        Tidying lit pats
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-388"></span><span>
</span><span id="line-389"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#tidyLitPat"><span class="hs-identifier hs-type">tidyLitPat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-390"></span><span class="hs-comment">-- Result has only the following HsLits:</span><span>
</span><span id="line-391"></span><span class="hs-comment">--      HsIntPrim, HsWordPrim, HsCharPrim, HsFloatPrim</span><span>
</span><span id="line-392"></span><span class="hs-comment">--      HsDoublePrim, HsStringPrim, HsString</span><span>
</span><span id="line-393"></span><span class="hs-comment">--  * HsInteger, HsRat, HsInt can't show up in LitPats</span><span>
</span><span id="line-394"></span><span class="hs-comment">--  * We get rid of HsChar right here</span><span>
</span><span id="line-395"></span><span id="tidyLitPat"><span class="annot"><span class="annottext">tidyLitPat :: HsLit GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.Literal.html#tidyLitPat"><span class="hs-identifier hs-var hs-var">tidyLitPat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsChar"><span class="hs-identifier hs-type">HsChar</span></a></span><span> </span><span id="local-6989586621681148029"><span class="annot"><span class="annottext">XHsChar GhcTc
</span><a href="#local-6989586621681148029"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621681148028"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148028"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourceText -&gt; Char -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkCharLitPat"><span class="hs-identifier hs-var">mkCharLitPat</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
XHsChar GhcTc
</span><a href="#local-6989586621681148029"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148028"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-396"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#tidyLitPat"><span class="hs-identifier hs-var">tidyLitPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsString"><span class="hs-identifier hs-type">HsString</span></a></span><span> </span><span id="local-6989586621681148025"><span class="annot"><span class="annottext">XHsString GhcTc
</span><a href="#local-6989586621681148025"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621681148024"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681148024"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#lengthFS"><span class="hs-identifier hs-var">lengthFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681148024"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>     </span><span class="hs-comment">-- Short string literals only</span><span>
</span><span id="line-398"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc)
-&gt; GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Char
 -&gt; GenLocated SrcSpan (Pat GhcTc)
 -&gt; GenLocated SrcSpan (Pat GhcTc))
-&gt; GenLocated SrcSpan (Pat GhcTc)
-&gt; String
-&gt; GenLocated SrcSpan (Pat GhcTc)
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681148020"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148020"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621681148019"><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
</span><a href="#local-6989586621681148019"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [LPat GhcTc] -&gt; [Type] -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkPrefixConPat"><span class="hs-identifier hs-var">mkPrefixConPat</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#consDataCon"><span class="hs-identifier hs-var">consDataCon</span></a></span><span>
</span><span id="line-399"></span><span>                                             </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SourceText -&gt; Char -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkCharLitPat"><span class="hs-identifier hs-var">mkCharLitPat</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
XHsString GhcTc
</span><a href="#local-6989586621681148025"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681148020"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681148019"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#charTy"><span class="hs-identifier hs-var">charTy</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkNilPat"><span class="hs-identifier hs-var">mkNilPat</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#charTy"><span class="hs-identifier hs-var">charTy</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681148024"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-comment">-- The stringTy is the type of the whole pattern, not</span><span>
</span><span id="line-402"></span><span>        </span><span class="hs-comment">-- the type to instantiate (:) or [] with!</span><span>
</span><span id="line-403"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#tidyLitPat"><span class="hs-identifier hs-var">tidyLitPat</span></a></span><span> </span><span id="local-6989586621681148013"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681148013"><span class="hs-identifier hs-var">lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XLitPat GhcTc -&gt; HsLit GhcTc -&gt; Pat GhcTc
forall p. XLitPat p -&gt; HsLit p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-var">LitPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XLitPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681148013"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="hs-comment">----------------</span><span>
</span><span id="line-406"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#tidyNPat"><span class="hs-identifier hs-type">tidyNPat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsOverLit"><span class="hs-identifier hs-type">HsOverLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-407"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-408"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-409"></span><span id="tidyNPat"><span class="annot"><span class="annottext">tidyNPat :: HsOverLit GhcTc
-&gt; Maybe (SyntaxExpr GhcTc)
-&gt; SyntaxExpr GhcTc
-&gt; Type
-&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.Literal.html#tidyNPat"><span class="hs-identifier hs-var hs-var">tidyNPat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#OverLit"><span class="hs-identifier hs-type">OverLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#OverLitTc"><span class="hs-identifier hs-type">OverLitTc</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span id="local-6989586621681148010"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148010"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681148009"><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681148009"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681148008"><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681148008"><span class="hs-identifier hs-var">mb_neg</span></a></span></span><span> </span><span id="local-6989586621681148007"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681148007"><span class="hs-identifier hs-var">_eq</span></a></span></span><span> </span><span id="local-6989586621681148006"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148006"><span class="hs-identifier hs-var">outer_ty</span></a></span></span><span>
</span><span id="line-410"></span><span>        </span><span class="hs-comment">-- False: Take short cuts only if the literal is not using rebindable syntax</span><span>
</span><span id="line-411"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-412"></span><span>        </span><span class="hs-comment">-- Once that is settled, look for cases where the type of the</span><span>
</span><span id="line-413"></span><span>        </span><span class="hs-comment">-- entire overloaded literal matches the type of the underlying literal,</span><span>
</span><span id="line-414"></span><span>        </span><span class="hs-comment">-- and in that case take the short cut</span><span>
</span><span id="line-415"></span><span>        </span><span class="hs-comment">-- NB: Watch out for weird cases like #3382</span><span>
</span><span id="line-416"></span><span>        </span><span class="hs-comment">--        f :: Int -&gt; Int</span><span>
</span><span id="line-417"></span><span>        </span><span class="hs-comment">--        f &quot;blah&quot; = 4</span><span>
</span><span id="line-418"></span><span>        </span><span class="hs-comment">--     which might be ok if we have 'instance IsString Int'</span><span>
</span><span id="line-419"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-420"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681148005"><span class="hs-identifier hs-var">type_change</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isIntTy"><span class="hs-identifier hs-var">isIntTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148010"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148003"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148003"><span class="hs-identifier hs-var">int_lit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe Integer
</span><a href="#local-6989586621681148002"><span class="hs-identifier hs-var">mb_int_lit</span></a></span><span>
</span><span id="line-421"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; HsLit GhcTc -&gt; Pat GhcTc
</span><a href="#local-6989586621681148001"><span class="hs-identifier hs-var">mk_con_pat</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#intDataCon"><span class="hs-identifier hs-var">intDataCon</span></a></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XHsIntPrim GhcTc -&gt; Integer -&gt; HsLit GhcTc
forall x. XHsIntPrim x -&gt; Integer -&gt; HsLit x
</span><a href="GHC.Hs.Lit.html#HsIntPrim"><span class="hs-identifier hs-var">HsIntPrim</span></a></span><span>    </span><span class="annot"><span class="annottext">SourceText
XHsIntPrim GhcTc
</span><a href="GHC.Types.Basic.html#NoSourceText"><span class="hs-identifier hs-var">NoSourceText</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681148003"><span class="hs-identifier hs-var">int_lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681148005"><span class="hs-identifier hs-var">type_change</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isWordTy"><span class="hs-identifier hs-var">isWordTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148010"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span>   </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681147997"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147997"><span class="hs-identifier hs-var">int_lit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe Integer
</span><a href="#local-6989586621681148002"><span class="hs-identifier hs-var">mb_int_lit</span></a></span><span>
</span><span id="line-423"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; HsLit GhcTc -&gt; Pat GhcTc
</span><a href="#local-6989586621681148001"><span class="hs-identifier hs-var">mk_con_pat</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#wordDataCon"><span class="hs-identifier hs-var">wordDataCon</span></a></span><span>   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XHsWordPrim GhcTc -&gt; Integer -&gt; HsLit GhcTc
forall x. XHsWordPrim x -&gt; Integer -&gt; HsLit x
</span><a href="GHC.Hs.Lit.html#HsWordPrim"><span class="hs-identifier hs-var">HsWordPrim</span></a></span><span>   </span><span class="annot"><span class="annottext">SourceText
XHsWordPrim GhcTc
</span><a href="GHC.Types.Basic.html#NoSourceText"><span class="hs-identifier hs-var">NoSourceText</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147997"><span class="hs-identifier hs-var">int_lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681148005"><span class="hs-identifier hs-var">type_change</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isStringTy"><span class="hs-identifier hs-var">isStringTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148010"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681147994"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681147994"><span class="hs-identifier hs-var">str_lit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681147993"><span class="hs-identifier hs-var">mb_str_lit</span></a></span><span>
</span><span id="line-425"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Match.Literal.html#tidyLitPat"><span class="hs-identifier hs-var">tidyLitPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XHsString GhcTc -&gt; FastString -&gt; HsLit GhcTc
forall x. XHsString x -&gt; FastString -&gt; HsLit x
</span><a href="GHC.Hs.Lit.html#HsString"><span class="hs-identifier hs-var">HsString</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
XHsString GhcTc
</span><a href="GHC.Types.Basic.html#NoSourceText"><span class="hs-identifier hs-var">NoSourceText</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681147994"><span class="hs-identifier hs-var">str_lit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span>     </span><span class="hs-comment">-- NB: do /not/ convert Float or Double literals to F# 3.8 or D# 5.3</span><span>
</span><span id="line-427"></span><span>     </span><span class="hs-comment">-- If we do convert to the constructor form, we'll generate a case</span><span>
</span><span id="line-428"></span><span>     </span><span class="hs-comment">-- expression on a Float# or Double# and that's not allowed in Core; see</span><span>
</span><span id="line-429"></span><span>     </span><span class="hs-comment">-- #9238 and Note [Rules for floating-point comparisons] in GHC.Core.Opt.ConstantFold</span><span>
</span><span id="line-430"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-431"></span><span>    </span><span class="hs-comment">-- Sometimes (like in test case</span><span>
</span><span id="line-432"></span><span>    </span><span class="hs-comment">-- overloadedlists/should_run/overloadedlistsrun04), the SyntaxExprs include</span><span>
</span><span id="line-433"></span><span>    </span><span class="hs-comment">-- type-changing wrappers (for example, from Id Int to Int, for the identity</span><span>
</span><span id="line-434"></span><span>    </span><span class="hs-comment">-- type family Id). In these cases, we can't do the short-cut.</span><span>
</span><span id="line-435"></span><span>    </span><span id="local-6989586621681148005"><span class="annot"><span class="annottext">type_change :: Bool
</span><a href="#local-6989586621681148005"><span class="hs-identifier hs-var hs-var">type_change</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148006"><span class="hs-identifier hs-var">outer_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148010"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span>    </span><span class="annot"><a href="#local-6989586621681148001"><span class="hs-identifier hs-type">mk_con_pat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-438"></span><span>    </span><span id="local-6989586621681148001"><span class="annot"><span class="annottext">mk_con_pat :: DataCon -&gt; HsLit GhcTc -&gt; Pat GhcTc
</span><a href="#local-6989586621681148001"><span class="hs-identifier hs-var hs-var">mk_con_pat</span></a></span></span><span> </span><span id="local-6989586621681147992"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681147992"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681147991"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681147991"><span class="hs-identifier hs-var">lit</span></a></span></span><span>
</span><span id="line-439"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [LPat GhcTc] -&gt; [Type] -&gt; LPat GhcTc
</span><a href="GHC.Hs.Pat.html#mkPrefixConPat"><span class="hs-identifier hs-var">mkPrefixConPat</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681147992"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc))
-&gt; Pat GhcTc -&gt; GenLocated SrcSpan (Pat GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XLitPat GhcTc -&gt; HsLit GhcTc -&gt; Pat GhcTc
forall p. XLitPat p -&gt; HsLit p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-var">LitPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XLitPat GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681147991"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span>    </span><span class="annot"><a href="#local-6989586621681148002"><span class="hs-identifier hs-type">mb_int_lit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>
</span><span id="line-442"></span><span>    </span><span id="local-6989586621681148002"><span class="annot"><span class="annottext">mb_int_lit :: Maybe Integer
</span><a href="#local-6989586621681148002"><span class="hs-identifier hs-var hs-var">mb_int_lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
Maybe SyntaxExprTc
</span><a href="#local-6989586621681148008"><span class="hs-identifier hs-var">mb_neg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681148009"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-443"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntegral"><span class="hs-identifier hs-type">HsIntegral</span></a></span><span> </span><span id="local-6989586621681147989"><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681147989"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Maybe Integer
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var hs-var">il_value</span></a></span><span> </span><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681147989"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>  </span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntegral"><span class="hs-identifier hs-type">HsIntegral</span></a></span><span> </span><span id="local-6989586621681147988"><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681147988"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Maybe Integer
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntegralLit -&gt; Integer
</span><a href="GHC.Types.Basic.html#il_value"><span class="hs-identifier hs-var hs-var">il_value</span></a></span><span> </span><span class="annot"><span class="annottext">IntegralLit
</span><a href="#local-6989586621681147988"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span>                   </span><span class="annot"><span class="annottext">(Maybe SyntaxExprTc, OverLitVal)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Integer
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-446"></span><span>
</span><span id="line-447"></span><span>    </span><span class="annot"><a href="#local-6989586621681147993"><span class="hs-identifier hs-type">mb_str_lit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-448"></span><span>    </span><span id="local-6989586621681147993"><span class="annot"><span class="annottext">mb_str_lit :: Maybe FastString
</span><a href="#local-6989586621681147993"><span class="hs-identifier hs-var hs-var">mb_str_lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
Maybe SyntaxExprTc
</span><a href="#local-6989586621681148008"><span class="hs-identifier hs-var">mb_neg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OverLitVal
</span><a href="#local-6989586621681148009"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-449"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsIsString"><span class="hs-identifier hs-type">HsIsString</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147986"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681147986"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Maybe FastString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681147986"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-450"></span><span>                   </span><span class="annot"><span class="annottext">(Maybe SyntaxExprTc, OverLitVal)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-451"></span><span>
</span><span id="line-452"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#tidyNPat"><span class="hs-identifier hs-var">tidyNPat</span></a></span><span> </span><span id="local-6989586621681147985"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147985"><span class="hs-identifier hs-var">over_lit</span></a></span></span><span> </span><span id="local-6989586621681147984"><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681147984"><span class="hs-identifier hs-var">mb_neg</span></a></span></span><span> </span><span id="local-6989586621681147983"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681147983"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span id="local-6989586621681147982"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147982"><span class="hs-identifier hs-var">outer_ty</span></a></span></span><span>
</span><span id="line-453"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XNPat GhcTc
-&gt; Located (HsOverLit GhcTc)
-&gt; Maybe (SyntaxExpr GhcTc)
-&gt; SyntaxExpr GhcTc
-&gt; Pat GhcTc
forall p.
XNPat p
-&gt; Located (HsOverLit p)
-&gt; Maybe (SyntaxExpr p)
-&gt; SyntaxExpr p
-&gt; Pat p
</span><a href="GHC.Hs.Pat.html#NPat"><span class="hs-identifier hs-var">NPat</span></a></span><span> </span><span class="annot"><span class="annottext">Type
XNPat GhcTc
</span><a href="#local-6989586621681147982"><span class="hs-identifier hs-var">outer_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; Located (HsOverLit GhcTc)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147985"><span class="hs-identifier hs-var">over_lit</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681147984"><span class="hs-identifier hs-var">mb_neg</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681147983"><span class="hs-identifier hs-var">eq</span></a></span><span>
</span><span id="line-454"></span><span>
</span><span id="line-455"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Pattern matching on LitPat
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#matchLiterals"><span class="hs-identifier hs-type">matchLiterals</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-464"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-comment">-- ^ Type of the whole case expression</span><span>
</span><span id="line-465"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ All PgLits</span><span>
</span><span id="line-466"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-467"></span><span>
</span><span id="line-468"></span><span id="matchLiterals"><span class="annot"><span class="annottext">matchLiterals :: NonEmpty Id
-&gt; Type
-&gt; NonEmpty (NonEmpty EquationInfo)
-&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Literal.html#matchLiterals"><span class="hs-identifier hs-var hs-var">matchLiterals</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681147980"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147980"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681147978"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681147978"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681147977"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147977"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681147976"><span class="annot"><span class="annottext">NonEmpty (NonEmpty EquationInfo)
</span><a href="#local-6989586621681147976"><span class="hs-identifier hs-var">sub_groups</span></a></span></span><span>
</span><span id="line-469"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span>       </span><span class="hs-comment">-- Deal with each group</span><span>
</span><span id="line-470"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147975"><span class="annot"><span class="annottext">NonEmpty (Literal, MatchResult CoreExpr)
</span><a href="#local-6989586621681147975"><span class="hs-identifier hs-var">alts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) (Literal, MatchResult CoreExpr))
-&gt; NonEmpty (NonEmpty EquationInfo)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv) (NonEmpty (Literal, MatchResult CoreExpr))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Literal, MatchResult CoreExpr)
</span><a href="#local-6989586621681147973"><span class="hs-identifier hs-var">match_group</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (NonEmpty EquationInfo)
</span><a href="#local-6989586621681147976"><span class="hs-identifier hs-var">sub_groups</span></a></span><span>
</span><span id="line-471"></span><span>
</span><span id="line-472"></span><span>                </span><span class="hs-comment">-- Combine results.  For everything except String</span><span>
</span><span id="line-473"></span><span>                </span><span class="hs-comment">-- we can use a case expression; for String we need</span><span>
</span><span id="line-474"></span><span>                </span><span class="hs-comment">-- a chain of if-then-else</span><span>
</span><span id="line-475"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isStringTy"><span class="hs-identifier hs-var">isStringTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147980"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-476"></span><span>            </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681147971"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147971"><span class="hs-identifier hs-var">eq_str</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM Id
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#eqStringName"><span class="hs-identifier hs-var">eqStringName</span></a></span><span>
</span><span id="line-477"></span><span>                </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147968"><span class="annot"><span class="annottext">NonEmpty (MatchResult CoreExpr)
</span><a href="#local-6989586621681147968"><span class="hs-identifier hs-var">mrs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((Literal, MatchResult CoreExpr) -&gt; DsM (MatchResult CoreExpr))
-&gt; NonEmpty (Literal, MatchResult CoreExpr)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (NonEmpty (MatchResult CoreExpr))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; (Literal, MatchResult CoreExpr) -&gt; DsM (MatchResult CoreExpr)
</span><a href="#local-6989586621681147967"><span class="hs-identifier hs-var">wrap_str_guard</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147971"><span class="hs-identifier hs-var">eq_str</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NonEmpty (Literal, MatchResult CoreExpr)
</span><a href="#local-6989586621681147975"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-478"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(MatchResult CoreExpr
 -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr)
-&gt; NonEmpty (MatchResult CoreExpr) -&gt; MatchResult CoreExpr
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#combineMatchResults"><span class="hs-identifier hs-var">combineMatchResults</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (MatchResult CoreExpr)
</span><a href="#local-6989586621681147968"><span class="hs-identifier hs-var">mrs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-479"></span><span>          </span><span class="hs-keyword">else</span><span>
</span><span id="line-480"></span><span>            </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
-&gt; Type
-&gt; [(Literal, MatchResult CoreExpr)]
-&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkCoPrimCaseMatchResult"><span class="hs-identifier hs-var">mkCoPrimCaseMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147980"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147977"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">([(Literal, MatchResult CoreExpr)] -&gt; MatchResult CoreExpr)
-&gt; [(Literal, MatchResult CoreExpr)] -&gt; MatchResult CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (Literal, MatchResult CoreExpr)
-&gt; [(Literal, MatchResult CoreExpr)]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (Literal, MatchResult CoreExpr)
</span><a href="#local-6989586621681147975"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-481"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-482"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-483"></span><span>    </span><span class="annot"><a href="#local-6989586621681147973"><span class="hs-identifier hs-type">match_group</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-484"></span><span>    </span><span id="local-6989586621681147973"><span class="annot"><span class="annottext">match_group :: NonEmpty EquationInfo
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Literal, MatchResult CoreExpr)
</span><a href="#local-6989586621681147973"><span class="hs-identifier hs-var hs-var">match_group</span></a></span></span><span> </span><span id="local-6989586621681147962"><span class="annot"><span class="annottext">eqns :: NonEmpty EquationInfo
</span><a href="#local-6989586621681147962"><span class="hs-identifier hs-var">eqns</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681147961"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147961"><span class="hs-identifier hs-var">firstEqn</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-485"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681147960"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681147960"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-486"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681147959"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681147959"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681147960"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-487"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-type">LitPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLitPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147958"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681147958"><span class="hs-identifier hs-var">hs_lit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EquationInfo -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Utils.html#firstPat"><span class="hs-identifier hs-var">firstPat</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147961"><span class="hs-identifier hs-var">firstEqn</span></a></span><span>
</span><span id="line-488"></span><span>             </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147956"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147956"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681147978"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147977"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; [EquationInfo]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NEL.toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty EquationInfo -&gt; [EquationInfo])
-&gt; NonEmpty EquationInfo -&gt; [EquationInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo -&gt; NonEmpty EquationInfo
forall (f :: * -&gt; *). Functor f =&gt; f EquationInfo -&gt; f EquationInfo
</span><a href="GHC.HsToCore.Utils.html#shiftEqns"><span class="hs-identifier hs-var">shiftEqns</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty EquationInfo
</span><a href="#local-6989586621681147962"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-489"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Literal, MatchResult CoreExpr)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Literal, MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; HsLit GhcTc -&gt; Literal
</span><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147959"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681147958"><span class="hs-identifier hs-var">hs_lit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147956"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span>    </span><span class="annot"><a href="#local-6989586621681147967"><span class="hs-identifier hs-type">wrap_str_guard</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-492"></span><span>        </span><span class="hs-comment">-- Equality check for string literals</span><span>
</span><span id="line-493"></span><span>    </span><span id="local-6989586621681147967"><span class="annot"><span class="annottext">wrap_str_guard :: Id -&gt; (Literal, MatchResult CoreExpr) -&gt; DsM (MatchResult CoreExpr)
</span><a href="#local-6989586621681147967"><span class="hs-identifier hs-var hs-var">wrap_str_guard</span></a></span></span><span> </span><span id="local-6989586621681147954"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147954"><span class="hs-identifier hs-var">eq_str</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitString"><span class="hs-identifier hs-type">LitString</span></a></span><span> </span><span id="local-6989586621681147953"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681147953"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681147952"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147952"><span class="hs-identifier hs-var">mr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-494"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- We now have to convert back to FastString. Perhaps there</span><span>
</span><span id="line-495"></span><span>               </span><span class="hs-comment">-- should be separate LitBytes and LitString constructors?</span><span>
</span><span id="line-496"></span><span>               </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681147951"><span class="annot"><span class="annottext">s' :: FastString
</span><a href="#local-6989586621681147951"><span class="hs-identifier hs-var hs-var">s'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringByteString"><span class="hs-identifier hs-var">mkFastStringByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621681147953"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-497"></span><span>             </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147949"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147949"><span class="hs-identifier hs-var">lit</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; DsM CoreExpr
forall (m :: * -&gt; *). MonadThings m =&gt; FastString -&gt; m CoreExpr
</span><a href="GHC.Core.Make.html#mkStringExprFS"><span class="hs-identifier hs-var">mkStringExprFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681147951"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-498"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681147948"><span class="annot"><span class="annottext">pred :: CoreExpr
</span><a href="#local-6989586621681147948"><span class="hs-identifier hs-var hs-var">pred</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147954"><span class="hs-identifier hs-var">eq_str</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147980"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147949"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-499"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkGuardedMatchResult"><span class="hs-identifier hs-var">mkGuardedMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147948"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147952"><span class="hs-identifier hs-var">mr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-500"></span><span>    </span><span class="annot"><a href="#local-6989586621681147967"><span class="hs-identifier hs-var">wrap_str_guard</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681147944"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681147944"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; DsM (MatchResult CoreExpr)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchLiterals/wrap_str_guard&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621681147944"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-501"></span><span>
</span><span id="line-502"></span><span>
</span><span id="line-503"></span><span class="hs-comment">---------------------------</span><span>
</span><span id="line-504"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-type">hsLitKey</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Lit.html#HsLit"><span class="hs-identifier hs-type">HsLit</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span>
</span><span id="line-505"></span><span class="hs-comment">-- Get the Core literal corresponding to a HsLit.</span><span>
</span><span id="line-506"></span><span class="hs-comment">-- It only works for primitive types and strings;</span><span>
</span><span id="line-507"></span><span class="hs-comment">-- others have been removed by tidy</span><span>
</span><span id="line-508"></span><span class="hs-comment">-- For HsString, it produces a LitString, which really represents an _unboxed_</span><span>
</span><span id="line-509"></span><span class="hs-comment">-- string literal; and we deal with it in matchLiterals above. Otherwise, it</span><span>
</span><span id="line-510"></span><span class="hs-comment">-- produces a primitive Literal of type matching the original HsLit.</span><span>
</span><span id="line-511"></span><span class="hs-comment">-- In the case of the fixed-width numeric types, we need to wrap here</span><span>
</span><span id="line-512"></span><span class="hs-comment">-- because Literal has an invariant that the literal is in range, while</span><span>
</span><span id="line-513"></span><span class="hs-comment">-- HsLit does not.</span><span>
</span><span id="line-514"></span><span id="hsLitKey"><span class="annot"><span class="annottext">hsLitKey :: Platform -&gt; HsLit GhcTc -&gt; Literal
</span><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var hs-var">hsLitKey</span></a></span></span><span> </span><span id="local-6989586621681147943"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147943"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsIntPrim"><span class="hs-identifier hs-type">HsIntPrim</span></a></span><span>    </span><span class="annot"><span class="annottext">XHsIntPrim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147942"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147942"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitIntWrap"><span class="hs-identifier hs-var">mkLitIntWrap</span></a></span><span>  </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147943"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147942"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-515"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span id="local-6989586621681147941"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147941"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsWordPrim"><span class="hs-identifier hs-type">HsWordPrim</span></a></span><span>   </span><span class="annot"><span class="annottext">XHsWordPrim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147940"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147940"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitWordWrap"><span class="hs-identifier hs-var">mkLitWordWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147941"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147940"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-516"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span id="local-6989586621681147939"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147939"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsInt64Prim"><span class="hs-identifier hs-type">HsInt64Prim</span></a></span><span>  </span><span class="annot"><span class="annottext">XHsInt64Prim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147938"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147938"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitInt64Wrap"><span class="hs-identifier hs-var">mkLitInt64Wrap</span></a></span><span>  </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147939"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147938"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-517"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span id="local-6989586621681147937"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147937"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsWord64Prim"><span class="hs-identifier hs-type">HsWord64Prim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsWord64Prim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147936"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147936"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitWord64Wrap"><span class="hs-identifier hs-var">mkLitWord64Wrap</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681147937"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681147936"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-518"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsCharPrim"><span class="hs-identifier hs-type">HsCharPrim</span></a></span><span>   </span><span class="annot"><span class="annottext">XHsCharPrim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147935"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681147935"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitChar"><span class="hs-identifier hs-var">mkLitChar</span></a></span><span>            </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681147935"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-519"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsFloatPrim"><span class="hs-identifier hs-type">HsFloatPrim</span></a></span><span>  </span><span class="annot"><span class="annottext">XHsFloatPrim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147933"><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681147933"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitFloat"><span class="hs-identifier hs-var">mkLitFloat</span></a></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FractionalLit -&gt; Rational
</span><a href="GHC.Types.Basic.html#fl_value"><span class="hs-identifier hs-var hs-var">fl_value</span></a></span><span> </span><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681147933"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-520"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsDoublePrim"><span class="hs-identifier hs-type">HsDoublePrim</span></a></span><span> </span><span class="annot"><span class="annottext">XHsDoublePrim GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147931"><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681147931"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitDouble"><span class="hs-identifier hs-var">mkLitDouble</span></a></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FractionalLit -&gt; Rational
</span><a href="GHC.Types.Basic.html#fl_value"><span class="hs-identifier hs-var hs-var">fl_value</span></a></span><span> </span><span class="annot"><span class="annottext">FractionalLit
</span><a href="#local-6989586621681147931"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-521"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Lit.html#HsString"><span class="hs-identifier hs-type">HsString</span></a></span><span> </span><span class="annot"><span class="annottext">XHsString GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147929"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681147929"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitString"><span class="hs-identifier hs-var">LitString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681147929"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-522"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#hsLitKey"><span class="hs-identifier hs-var">hsLitKey</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><span class="hs-identifier">_</span></span><span>        </span><span id="local-6989586621681147927"><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681147927"><span class="hs-identifier hs-var">l</span></a></span></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Literal
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;hsLitKey&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsLit GhcTc -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcTc
</span><a href="#local-6989586621681147927"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-523"></span><span>
</span><span id="line-524"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Pattern matching on NPat
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-531"></span><span>
</span><span id="line-532"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#matchNPats"><span class="hs-identifier hs-type">matchNPats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-533"></span><span id="matchNPats"><span class="annot"><span class="annottext">matchNPats :: NonEmpty Id
-&gt; Type -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Literal.html#matchNPats"><span class="hs-identifier hs-var hs-var">matchNPats</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681147926"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147926"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681147925"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681147925"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681147924"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147924"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681147923"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147923"><span class="hs-identifier hs-var">eqn1</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681147922"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681147922"><span class="hs-identifier hs-var">eqns</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- All for the same literal</span><span>
</span><span id="line-534"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#NPat"><span class="hs-identifier hs-type">NPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147921"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147921"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681147920"><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcTc)
</span><a href="#local-6989586621681147920"><span class="hs-identifier hs-var">mb_neg</span></a></span></span><span> </span><span id="local-6989586621681147919"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681147919"><span class="hs-identifier hs-var">eq_chk</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EquationInfo -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Utils.html#firstPat"><span class="hs-identifier hs-var">firstPat</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147923"><span class="hs-identifier hs-var">eqn1</span></a></span><span>
</span><span id="line-535"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147918"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147918"><span class="hs-identifier hs-var">lit_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.Literal.html#dsOverLit"><span class="hs-identifier hs-var">dsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147921"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-536"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147917"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147917"><span class="hs-identifier hs-var">neg_lit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="#local-6989586621681147920"><span class="hs-identifier hs-var">mb_neg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-537"></span><span>                            </span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147918"><span class="hs-identifier hs-var">lit_expr</span></a></span><span>
</span><span id="line-538"></span><span>                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681147916"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681147916"><span class="hs-identifier hs-var">neg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681147916"><span class="hs-identifier hs-var">neg</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147918"><span class="hs-identifier hs-var">lit_expr</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-539"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147915"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147915"><span class="hs-identifier hs-var">pred_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681147919"><span class="hs-identifier hs-var">eq_chk</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147926"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147917"><span class="hs-identifier hs-var">neg_lit</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-540"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147914"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147914"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681147925"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147924"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EquationInfo] -&gt; [EquationInfo]
forall (f :: * -&gt; *). Functor f =&gt; f EquationInfo -&gt; f EquationInfo
</span><a href="GHC.HsToCore.Utils.html#shiftEqns"><span class="hs-identifier hs-var">shiftEqns</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147923"><span class="hs-identifier hs-var">eqn1</span></a></span><span class="annot"><span class="annottext">EquationInfo -&gt; [EquationInfo] -&gt; [EquationInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681147922"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-541"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkGuardedMatchResult"><span class="hs-identifier hs-var">mkGuardedMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147915"><span class="hs-identifier hs-var">pred_expr</span></a></span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147914"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-542"></span><span>
</span><span id="line-543"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Pattern matching on n+k patterns
*                                                                      *
************************************************************************

For an n+k pattern, we use the various magic expressions we've been given.
We generate:
\begin{verbatim}
    if ge var lit then
        let n = sub var lit
        in  &lt;expr-for-a-successful-match&gt;
    else
        &lt;try-next-pattern-or-whatever&gt;
\end{verbatim}
-}</span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span class="annot"><a href="GHC.HsToCore.Match.Literal.html#matchNPlusKPats"><span class="hs-identifier hs-type">matchNPlusKPats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html#EquationInfo"><span class="hs-identifier hs-type">EquationInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#MatchResult"><span class="hs-identifier hs-type">MatchResult</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-562"></span><span class="hs-comment">-- All NPlusKPats, for the *same* literal k</span><span>
</span><span id="line-563"></span><span id="matchNPlusKPats"><span class="annot"><span class="annottext">matchNPlusKPats :: NonEmpty Id
-&gt; Type -&gt; NonEmpty EquationInfo -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.Literal.html#matchNPlusKPats"><span class="hs-identifier hs-var hs-var">matchNPlusKPats</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681147913"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147913"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681147912"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681147912"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681147911"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147911"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681147910"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147910"><span class="hs-identifier hs-var">eqn1</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621681147909"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681147909"><span class="hs-identifier hs-var">eqns</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-564"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#NPlusKPat"><span class="hs-identifier hs-type">NPlusKPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPlusKPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147907"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681147907"><span class="hs-identifier hs-var">n1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147906"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147906"><span class="hs-identifier hs-var">lit1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681147905"><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147905"><span class="hs-identifier hs-var">lit2</span></a></span></span><span> </span><span id="local-6989586621681147904"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681147904"><span class="hs-identifier hs-var">ge</span></a></span></span><span> </span><span id="local-6989586621681147903"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681147903"><span class="hs-identifier hs-var">minus</span></a></span></span><span>
</span><span id="line-565"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EquationInfo -&gt; Pat GhcTc
</span><a href="GHC.HsToCore.Utils.html#firstPat"><span class="hs-identifier hs-var">firstPat</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147910"><span class="hs-identifier hs-var">eqn1</span></a></span><span>
</span><span id="line-566"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147902"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147902"><span class="hs-identifier hs-var">lit1_expr</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.Literal.html#dsOverLit"><span class="hs-identifier hs-var">dsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147906"><span class="hs-identifier hs-var">lit1</span></a></span><span>
</span><span id="line-567"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147901"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147901"><span class="hs-identifier hs-var">lit2_expr</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Match.Literal.html#dsOverLit"><span class="hs-identifier hs-var">dsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><a href="#local-6989586621681147905"><span class="hs-identifier hs-var">lit2</span></a></span><span>
</span><span id="line-568"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147900"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147900"><span class="hs-identifier hs-var">pred_expr</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681147904"><span class="hs-identifier hs-var">ge</span></a></span><span>    </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147913"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147902"><span class="hs-identifier hs-var">lit1_expr</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-569"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147899"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147899"><span class="hs-identifier hs-var">minusk_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc -&gt; [CoreExpr] -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsSyntaxExpr"><span class="hs-identifier hs-var">dsSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681147903"><span class="hs-identifier hs-var">minus</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147913"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147901"><span class="hs-identifier hs-var">lit2_expr</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-570"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681147898"><span class="annot"><span class="annottext">[CoreExpr -&gt; CoreExpr]
</span><a href="#local-6989586621681147898"><span class="hs-identifier hs-var">wraps</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681147897"><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681147897"><span class="hs-identifier hs-var">eqns'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(EquationInfo -&gt; (CoreExpr -&gt; CoreExpr, EquationInfo))
-&gt; [EquationInfo] -&gt; ([CoreExpr -&gt; CoreExpr], [EquationInfo])
forall a b c. (a -&gt; (b, c)) -&gt; [a] -&gt; ([b], [c])
</span><a href="GHC.Utils.Misc.html#mapAndUnzip"><span class="hs-identifier hs-var">mapAndUnzip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; EquationInfo -&gt; (CoreExpr -&gt; CoreExpr, EquationInfo)
</span><a href="#local-6989586621681147895"><span class="hs-identifier hs-var">shift</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147907"><span class="hs-identifier hs-var">n1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147910"><span class="hs-identifier hs-var">eqn1</span></a></span><span class="annot"><span class="annottext">EquationInfo -&gt; [EquationInfo] -&gt; [EquationInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681147909"><span class="hs-identifier hs-var">eqns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-571"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681147894"><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147894"><span class="hs-identifier hs-var">match_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Type -&gt; [EquationInfo] -&gt; DsM (MatchResult CoreExpr)
</span><a href="GHC.HsToCore.Match.html#match"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681147912"><span class="hs-identifier hs-var">vars</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681147911"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[EquationInfo]
</span><a href="#local-6989586621681147897"><span class="hs-identifier hs-var">eqns'</span></a></span><span>
</span><span id="line-572"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchResult CoreExpr -&gt; DsM (MatchResult CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkGuardedMatchResult"><span class="hs-identifier hs-var">mkGuardedMatchResult</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147900"><span class="hs-identifier hs-var">pred_expr</span></a></span><span>               </span><span class="annot"><span class="annottext">(MatchResult CoreExpr -&gt; MatchResult CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-573"></span><span>                   </span><span class="annot"><span class="annottext">CoreBind -&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkCoLetMatchResult"><span class="hs-identifier hs-var">mkCoLetMatchResult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147907"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681147899"><span class="hs-identifier hs-var">minusk_expr</span></a></span><span class="hs-special">)</span><span>   </span><span class="annot"><span class="annottext">(MatchResult CoreExpr -&gt; MatchResult CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-574"></span><span>                   </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((CoreExpr -&gt; CoreExpr)
 -&gt; (CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr)
-&gt; [CoreExpr -&gt; CoreExpr] -&gt; CoreExpr -&gt; CoreExpr
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr)
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">(.)</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr -&gt; CoreExpr]
</span><a href="#local-6989586621681147898"><span class="hs-identifier hs-var">wraps</span></a></span><span class="hs-special">)</span><span>                      </span><span class="annot"><span class="annottext">(MatchResult CoreExpr -&gt; MatchResult CoreExpr)
-&gt; MatchResult CoreExpr -&gt; MatchResult CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-575"></span><span>                   </span><span class="annot"><span class="annottext">MatchResult CoreExpr
</span><a href="#local-6989586621681147894"><span class="hs-identifier hs-var">match_result</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-576"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-577"></span><span>    </span><span id="local-6989586621681147895"><span class="annot"><span class="annottext">shift :: Id -&gt; EquationInfo -&gt; (CoreExpr -&gt; CoreExpr, EquationInfo)
</span><a href="#local-6989586621681147895"><span class="hs-identifier hs-var hs-var">shift</span></a></span></span><span> </span><span id="local-6989586621681147886"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147886"><span class="hs-identifier hs-var">n1</span></a></span></span><span> </span><span id="local-6989586621681147885"><span class="annot"><span class="annottext">eqn :: EquationInfo
</span><a href="#local-6989586621681147885"><span class="hs-identifier hs-var">eqn</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.Monad.html#EqnInfo"><span class="hs-identifier hs-type">EqnInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: EquationInfo -&gt; [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#NPlusKPat"><span class="hs-identifier hs-type">NPlusKPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPlusKPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147882"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681147882"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Located (HsOverLit GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681147881"><span class="annot"><span class="annottext">[Pat GhcTc]
</span><a href="#local-6989586621681147881"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-578"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Utils.html#wrapBind"><span class="hs-identifier hs-var">wrapBind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681147882"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681147886"><span class="hs-identifier hs-var">n1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147885"><span class="hs-identifier hs-var">eqn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eqn_pats :: [Pat GhcTc]
</span><a href="GHC.HsToCore.Monad.html#eqn_pats"><span class="hs-identifier hs-var">eqn_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Pat GhcTc]
</span><a href="#local-6989586621681147881"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span>        </span><span class="hs-comment">-- The wrapBind is a no-op for the first equation</span><span>
</span><span id="line-580"></span><span>    </span><span class="annot"><a href="#local-6989586621681147895"><span class="hs-identifier hs-var">shift</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681147879"><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147879"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (CoreExpr -&gt; CoreExpr, EquationInfo)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;matchNPlusKPats/shift&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EquationInfo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EquationInfo
</span><a href="#local-6989586621681147879"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-581"></span></pre></body></html>